all: tracer/manual/icon.png tracer/manual/index.html tracer/resources.qrc

tracer/manual/icon.png: tracer/images/generated/icon.svg
	rsvg-convert -w 32 -h 32 tracer/images/generated/icon.svg > $@

tracer/images/generated/icon.svg: tracer/images/gen-icons.mp
	make -C tracer/images

tracer/manual/index.html: tracer/manual/index.rst
	rst2html --link-stylesheet --stylesheet-path=style.css $< > $@

tracer/resources.qrc: tracer/shaders tracer/images
	echo '<!-- vim: set ft=xml : -->' > $@
	echo '<!DOCTYPE RCC>' >> $@
	echo '<RCC version="1.0">' >> $@
	echo '  <qresource>' >> $@
	{ cd tracer/shaders; ls *.vert *.frag *.geom; } | sed 's,\(.*\),    <file>shaders/\1</file>,'  >> $@
	{ cd tracer/images; ls {breeze,generated}/*.svg; } | sed 's,\(.*\),    <file>images/\1</file>,'  >> $@
	echo '  </qresource>' >> $@
	echo '</RCC>' >> $@

.PHONY: all
